var provincename = '';
var cityname = '';
!function () {
    var $target = $('#J_Address');
    $target.citySelect();
    $target.on('click', function (event) {
        event.stopPropagation();
        $target.citySelect('open');
    });
    $target.on('done.ydui.cityselect', function (ret) {
        $(this).val(ret.provance + ' ' + ret.city);
        $('#info').val(ret.area + $('#info').val());
        provincename = ret.provance;
        cityname = ret.city;
    });
}();
function save() {
    if ($('#name').val() == '') {
        txttip('请填写收货人姓名');
        return;
    }
    if ($('#phone').val() == '') {
        txttip('请填写收货人手机号码');
        return;
    }
    if (provincename == '' || cityname == '') {
        txttip('请选择所在地区');
        return;
    }
    loading();
    $.post('/dos_m/save_address', { name: $('#name').val(), phone: $('#phone').val(), provincename: provincename, cityname: cityname, addressinfo: $('#info').val() }, function (d) { eval(d) });
}
function ok(c) {
    if (c == '') {
        location.href = '/shop/select_address_upgrade.html?x=' + x + '&price_start=' + price_start;
    }
    else {
        location.href = '/shop/add_upgrade_order.html?addresscode=' + c + '&x=' + x + '&price_start=' + price_start;
    }
}